//
//  EAFoodAndWaterController.m
//  WhatToEat
//
//  Created by 方力 on 15/7/29.
//  Copyright (c) 2015年 Mac. All rights reserved.
//
#import "EAThirstViewController.h"
#import "EAFoodAndWaterController.h"

@interface EAFoodAndWaterController ()
@property(strong,nonatomic)UIImageView * bgImageView;
@end

@implementation EAFoodAndWaterController

- (void)viewDidLoad {
    [super viewDidLoad];

    
    self.view.backgroundColor=kWhiteColor;
    UIImageView *iv=[[UIImageView alloc] initWithFrame:self.view.bounds];

    
  
    [self.view addSubview:iv];

    self.bgImageView=iv;
    iv.image=[UIImage imageNamed:@"xuanze_bg"];
    
  self.navigationItem.leftBarButtonItem = nil;
    
    self.navigationItem.title=@"吃神马";
    
}


-(void)viewWillLayoutSubviews
{
    [super viewWillLayoutSubviews];
    
    
    self.bgImageView.frame=self.view.bounds;
    UIButton *bt1=[UIButton buttonWithType:0];;
    bt1.frame=CGRectMake(kUI_SCREEN_WIDTH/2-90, kUI_SCREEN_HEIGHT-240, 180, 40);
    
    [bt1 setImage:[UIImage imageNamed:@"kele"] forState:0];
    bt1.tag=1;
    [self.view addSubview:bt1];
    
    
    UIButton *bt2=[UIButton buttonWithType:0];
    
    bt2.frame=CGRectMake(kUI_SCREEN_WIDTH/2-90, kUI_SCREEN_HEIGHT-180, 180, 40);
    [bt2 setImage:[UIImage imageNamed:@"ele"] forState:0];
    
    bt2.contentMode=UIViewContentModeScaleAspectFit;
    bt2.tag=2;
    [self.view addSubview:bt2];
    
    
    [bt1 addTarget:self action:@selector(toChooseFoot:) forControlEvents:UIControlEventTouchUpInside];
    [bt2 addTarget:self action:@selector(toChooseFoot:) forControlEvents:UIControlEventTouchUpInside];
    
    
}



-(void)toChooseFoot:(UIButton *)bt
{


    switch (bt.tag) {
        case 1:
        {
            
            UIStoryboard *str=[UIStoryboard storyboardWithName:@"Main" bundle:nil];
            
            
            UIViewController * vc=[str instantiateViewControllerWithIdentifier:@"EAEverydayChangeController"];
            
        
            ApplicationDelegate.isToRoot=NO;

            
            
            
              [self.navigationController pushViewController:vc animated:YES];
        
        
        }
            break;
            
             case 2:
        {
        
            
            EAThirstViewController * thVC=[[EAThirstViewController alloc] init];
            

            [self.navigationController pushViewController:thVC animated:YES];

        
        
        
        
        
        
        }
            
            
           break;
            
        default:
            break;
    }





}


@end
